
[#include "single/layout/layout02/layout.ftl"/]
[@htmlHead]

[/@htmlHead]

[@htmlBody]
<div class="row">
    <div class="col-xs-12">
        <ul class="nav nav-tabs ">
            <li>
                <a href="${base}/mail/account/view/index">
                    邮件账号列表
                </a>
            </li>
            [#if "add"==operateType]
                <li class="active"><a href="javascript:void(0)">邮件账号增加</a></li>
            [#else ]
                <li class="active"><a href="javascript:void(0)">邮件账号编辑</a></li>
            [/#if]

        </ul>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">

        <form class="form-horizontal" action="${base}/mail/view/update" method="post" id="editForm">
            <input type="hidden" name="id" value="${mailAccount.id}"/>

            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>所属系统</label>

                <div class="col-xs-10 col-sm-4  ">
                    <select name="appKey" class="form-control input-large ">
                        [#if appList?exists]
                            [#list appList as app]
                                <option value="${app.appKey}"
                                        [#if mailAccount.appKey=app.appKey] selected="selected" [/#if]>${app.appKey}</option>
                            [/#list]
                        [/#if]
                    </select>
                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>邮件服务器</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input name="host" value="${mailAccount.host}" placeholder="主机地址"
                           class="form-control input-large"/>
                </div>
            </div>
            <div class="form-group">
                <div id="editAlert" class="" style="min-width:550px"></div>
                <label class="col-xs-10 col-sm-4 control-label ">账号类型</label>

                <div class="col-xs-10 col-sm-4  ">

                    <input name="mailAccountType" value="${mailAccount.mailAccountType}" placeholder="新浪邮箱/QQ邮箱"
                           class="form-control input-large"/>

                </div>
            </div>

            <div class="form-group">
                <div id="editAlert" class="" style="min-width:550px"></div>
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>账号</label>

                <div class="col-xs-10 col-sm-4  ">

                    <input name="username" value="${mailAccount.username}" placeholder="账号"
                           class="form-control input-large"/>


                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>密码</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input name="password" value="${mailAccount.password}" placeholder="密码"
                           class="form-control input-large"/>
                </div>
            </div>
            <div class="form-group">
                <div id="editAlert" class="" style="min-width:550px"></div>
                <label class="col-xs-10 col-sm-4 control-label ">SMTP PORT属性</label>

                <div class="col-xs-10 col-sm-4  ">

                    <input name="port" value="${mailAccount.port}" class="form-control input-large"/>
                </div>
            </div>




            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label ">SMTP AUTH属性</label>

                <div class="col-xs-10 col-sm-4  ">
                    <select name="smtpAuth" class="form-control input-large ">
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label ">SMTP STARTTLS属性</label>

                <div class="col-xs-10 col-sm-4  ">
                    <select name="smtpStarttlsEnable" class="form-control input-large ">
                        <option value="1">启用</option>
                        <option value="0">禁用</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div id="editAlert" class="" style="min-width:550px"></div>
                <label class="col-xs-10 col-sm-4 control-label ">SMTP SSL属性</label>

                <div class="col-xs-10 col-sm-4  ">
                    <select name="smtpSsl" class="form-control input-large ">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label ">描述</label>

                <div class="col-xs-10 col-sm-4  ">
                    <textarea class="form-control input-large" name="description" id="description"
                              style="text-align: left;">${mailAccount.description}</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class=" col-xs-10 col-sm-4  control-label"></label>

                <div class="col-xs-10 col-sm-4 " align="center">
                    <input type="button" class="btn btn-info btn-sm" value="确定"
                           onclick="doMailAccountSubmit('${operateType}')"/>
                    <input type="button" onclick="tools.goto('${base}/mail/template/view/index')"
                           class="btn btn-cancle btn-sm" value="返回"/>
                </div>
            </div>
        </form>

    </div>
</div>
[/@htmlBody]

[@htmlFoot]
    [#include "common/validate.ftl"/]
<script src="${jpath}/assets/public/plugins/dialog/bootbox.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/mail/mail.js" type="text/javascript"></script>
<script type="text/javascript">

</script>


[/@htmlFoot]